package com.test.mchelepesa.bean_rice.rate_rice;

import com.google.gson.Gson;
import com.test.mchelepesa.util_rice.StringUtil_rice;

import org.json.JSONObject;

public class ActiveWindowConfig_rice {

    private static ActiveWindowConfig_rice instance;

    private ActiveWindowConfig_rice(){}

    public static ActiveWindowConfig_rice getInstance_pretfacile(){
        if (instance==null) instance = new ActiveWindowConfig_rice();
        return instance;
    }

    public static void parse(JSONObject jsonObject){
        instance = new Gson().fromJson(jsonObject.toString(), ActiveWindowConfig_rice.class);
        instance.switch1 = jsonObject.optString("switch");
    }

    private int num;
    private String content;
    private String switch1;

    public int getNum() {
        return num;
    }

    public String getContent() {
        return StringUtil_rice.getSafeString(content);
    }

    public boolean isSwitch(){
        return StringUtil_rice.getSafeString(switch1).equalsIgnoreCase("YES");
    }

}
